﻿using System.Web.Mvc;
using Common;
using Dto;

namespace YaoYunDong.Controllers
{
    public class BaseController : Controller
    {
        protected UsersDto UserDto = new UsersDto();
        protected AnnexUploadUtil Iuu = new AnnexUploadUtil();
        public BaseController()
        {
            if (System.Web.HttpContext.Current.Session["User"] != null)
            {
                UserDto = System.Web.HttpContext.Current.Session["User"] as UsersDto;
            }
            else
            {
                UserDto = null;
                System.Web.HttpContext.Current.Response.Write("<script>location.href='/Login.html';</script>");
                System.Web.HttpContext.Current.Response.End();
            }
        }
    }
}
